﻿
@{
    ViewBag.Title = "ADPZ";
    Layout = "~/Views/Shared/_LayoutForEUI.cshtml";
}

<table class="table table-celled">
    <thead>
    </thead>
    <tbody>
        <tr>
            <td><input class="easyui-textbox" labelalign="right" style="width:100%" label="ip地址:" id="AD_ADPZ_txtIP" value="@ViewBag.IP"/></td>
        </tr>
        <tr>
            <td><input class="easyui-textbox" labelalign="right"  style="width:100%" label="登录名:" id="AD_ADPZ_txtUName" value="@ViewBag.UNAME"/></td>
        </tr>
        <tr>
            <td><input class="easyui-textbox" labelalign="right" type="password" style="width:100%" label="密码:" id="AD_ADPZ_txtPwd" value="@ViewBag.PWD"/></td>
        </tr>
        <tr>
            <td><input class="easyui-textbox" labelalign="right" style="width:100%" label="OU:" id="AD_ADPZ_txtOU" value="@ViewBag.OU"/></td>
        </tr>
    </tbody>
    <tfoot>
        <tr>
            <th>
                   <a href="javascipt:void(0);" class="easyui-linkbutton button-blue pull-right" style="width:100px" data-options="iconCls:'icon-ok'" onclick="Add()">保存</a> 
            </th>
        </tr>
    </tfoot>
</table>
<script>
    function Add() {
        var ip = $("#AD_ADPZ_txtIP").val()
        var name = $("#AD_ADPZ_txtUName").val();
        var pwd = $("#AD_ADPZ_txtPwd").val();
        var ou = $("#AD_ADPZ_txtOU").val()
        if (name == "" || pwd == "") {
            $.messager.alert('提示', 'ip地址、用户名、密码或ou不能为空!', 'info');
        }
        else {
            $.ajax({
                url: '/AD/SaveADPZ',
                dataType: 'text',
                type: 'post',
                data: { ip: ip,username:name, pwd: pwd,ou:ou},//string ip,string username,string pwd,string ou
                success: function (data) {
                     $.messager.alert('提示！', "设置成功", 'info');
                }
            });
        }

    }
</script>
    

